package com.tianpengtech.admin;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

public class InitInterceptor implements Interceptor{

	public void intercept(Invocation inv) {

		Controller controller = inv.getController();
		if(controller instanceof AbstractAdminController){
			AbstractAdminController c = (AbstractAdminController)controller;
			c.config();
			c.addPage = "add-"+c.pageName()+".html";
			c.editPage = "edit-"+c.pageName()+".html";
			c.indexPage = c.pageName()+"-list.html";
			c.detailPage = c.pageName()+"-detail.html";
		}
		inv.invoke();
	}

}
